import scrapy


class BaiDu(scrapy.Spider):
    name = "BaiDu"

    # 爬虫入口
    def start_requests(self):
        url = "https://www.baidu.com/"

        # 发起一个http请求
        yield scrapy.Request(url=url, callback=self.parse)

    # response  响应
    def parse(self, response):
        # 获取网页内容
        print(response.text)
